#ifndef Ship_H_
#define Ship_H_

#include "../WidgetMovimiento.h"
#include "../Event.h"
#include "ShipStatus.h"
#include "../Timer.h"

class Ship: public WidgetMovimiento {

private:
	std::string imagePath;
	float rotationVelocity;
	int maximumVelocity;
	int propulsion;
	int friction;
	int bulletDuration;

	bool goingForward;
	bool goingBackwards;
	bool turningLeft;
	bool turningRight;
	bool shooting;
	bool keyPressed;
	int frame;
	int timeElapsedPropulsion;
	int timeElapsedFriction;
	Timer frictionTimer;
	Timer propulsionTimer;
	int angle0;
	bool combustion;
	std::string owner;
	float velocity;

	SDL_Surface* shipSurface;
	SDL_Surface* combustionShipSurface;

public:

	Ship(ShipStatus* shipStatus);

	Ship(std::string pathImage,float rotationVelocity,int velMaxima,int propulsion,
			int friccion,int duracionBala, int posX, int posY,
			Widget* parent, std::string owner,int angle = 90);

	virtual void handleEvent(Event event);

	virtual void resolve();

	ShipStatus getShipStatus();

	std::string getOwner();

	int getbulletX();
	int getbulletY();
	int getBulletAngle();
	bool isShooting();

	bool duenoesinstancialocal;
    int getBulletDuration() const;

	virtual ~Ship();
};

#endif /* Ship_H_ */
